package cn.kxx.mapper;

import cn.kxx.pojo.Permission;
import cn.kxx.pojo.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Auther: Kong Xiang Xiang
 * @Date: 2022/11/6 17:30
 * @DESC:
 */
@Repository
public interface RoleMapper {

    //查询所有角色信息
    List<Role> findAll();


    //查询角色详情
    Role findById(Integer id);

    void save(Role role);

    List<Permission> findRoleByIdAndAllPermission(Integer id);

    void addPermissionToRole(@Param("roleId") Integer roleId, @Param("id") int id);
}
